<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:mo="https://gitee.com/aun/Timo">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
</head>
<body>
<div class="layui-form timo-compile">
    <form th:action="@{/admin/quartz/job/save}">
        <input type="hidden" name="id" th:if="${entity}" th:value="${entity.id}"/>
        <div class="layui-form-item">
            <label class="layui-form-label required">所属应用</label>
            <div class="layui-input-inline">
                <select name="appId" th:value="${entity?.appId}" th:disable="${entity != null}">
                    <option th:each="item:${apps}" th:text="${item.appName}"
                            th:value="${item.id}" th:selected="(${item.id} == ${entity?.appId})"></option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">任务名称</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="jobName"  placeholder="请输入任务名称" th:value="${entity?.jobName}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">处理器名称</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="handlerName"  placeholder="请输入处理器名称" th:value="${entity?.handlerName}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">cron表达式</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="cronExpression"  placeholder="请输入cron表达式" th:value="${entity?.cronExpression}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">触发器</label>
            <div class="layui-input-inline">
                <select class="layui-input-inline" name="triggerClassName" th:value="${entity?.triggerClassName}">
                    <option th:each="triggerMap, triggerMapS:${trigger}" th:text="${triggerMap.value}"
                            th:value="${triggerMap.key}" th:selected="(${triggerMap.key} == ${entity?.triggerClassName})"></option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">执行模式</label>
            <div class="layui-input-inline">
                <select class="layui-input-inline" name="executeModel" th:value="${entity?.executeModel}">
                    <option th:each="executeModelMap, executeModelS:${executeModel}" th:text="${executeModelMap.value}"
                            th:value="${executeModelMap.key}" th:selected="(${executeModelMap.key} == ${entity?.executeModel})"></option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">路由策略</label>
            <div class="layui-input-inline">
                <select class="layui-input-inline" name="routeStrategy" th:value="${entity?.routeStrategy}">
                    <option th:each="routeStrategyMap, routeStrategyS:${routeStrategy}" th:text="${routeStrategyMap.value}"
                            th:value="${routeStrategyMap.key}" th:selected="(${routeStrategyMap.key} == ${entity?.routeStrategy})"></option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">阻塞策略</label>
            <div class="layui-input-inline">
                <select class="layui-input-inline" name="blockStrategy" th:value="${entity?.blockStrategy}">
                    <option th:each="blockStrategyMap, blockStrategyS:${blockStrategy}" th:text="${blockStrategyMap.value}"
                            th:value="${blockStrategyMap.key}" th:selected="(${blockStrategyMap.key} == ${entity?.blockStrategy})"></option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">执行参数</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="triggerParam"  placeholder="请输入执行参数" th:value="${entity?.triggerParam}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">执行超时时间</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="executeTimeout"  placeholder="请输入执行超时时间(异步任务有效)" th:value="${entity?.executeTimeout}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">失败重试次数</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="failRetryTimes"  placeholder="请输入失败重试次数" th:value="${entity?.failRetryTimes}">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入内容" class="layui-textarea" name="description">[[${entity?.description}]]</textarea>
            </div>
        </div>
        <div class="layui-form-item timo-finally">
            <button class="layui-btn ajax-submit"><i class="fa fa-check-circle"></i> 保存</button>
            <button class="layui-btn btn-secondary close-popup"><i class="fa fa-times-circle"></i> 关闭</button>
        </div>
    </form>
</div>
<script th:replace="/common/template :: script"></script>
</body>
</html>